<template>
	<view class="containers">

		<view class="main-app">
			<view class="header">
				<topWallet :getName="names" :isLogins="islogin"></topWallet>
			</view>
			<view class="main-content zh">
				<view class="m-0 row">
					<view class="col-12 pt-3 col">
						<view>
							<view class="m-0 row">
								<view class="col-12 mb-3 col">
									<p class="text-gold bold">{{$t('Equipment-Supply')}}</p>
								</view>
								<view class="col-12 p-0 col" v-for="(item,index) in financingData" :key="index">
									<view style="padding: 0.5em 0.3em;">
										<view class="active-card-package">
											<view class="card-package card">
												<view class="m-0 row">
													<view class="col-3 col-lg-3 col"><label
															class="name text-start">{{item['name']}}</label>
													</view>
													<view class="col-6 col"><label
															class="price justify-content-center">{{item['money']}}</label>
													</view>
													<view class="col-3 col-lg-3 d-flex align-items-center gap-2 col">
														<button type="button" @click="goBuy(item['type'])"
															class="package-button btn btn-primary">
															<label>{{payTypeStatus[0]['name']}}</label>
														</button>
													</view>
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="col-12 pt-3 col">
						<view>
							<view class="m-0 row" style="">
								<view class="col-12 col">
									<view class="d-flex align-items-center justify-content-between"><label
											class="text-gold bold">{{$t('Available-package')}}</label></view>
								</view>
								<view class="col-12 p-0 col" v-for="(item,index) in memberOrderData" :key="index">
									<view style="padding: 0.5em 0.3em;">
										<view class="active-card-package">
											<view class="card-package card">
												<view class="m-0 row">
													<view class="col-3 col"><label
															class="name">{{financingData[item['type']-1]['name']}}</label>
													</view>
													<view class="col-6 col"><label class="price justify-content-center"
															style="font-size: 22rpx;"></label>
													</view>
													<view class="col-3 d-flex align-items-center col"><button
															@click="uplevel(item.id,item.type)" v-if="item.type<3"
															type="button" class="package-button btn btn-primary"><label
																style="font-size: 10px;">{{$t('Upgrades')}}</label></button>

													</view>
													<view class="col-3 d-flex align-items-center col"></view>
												</view>
											</view>
											<view class="position-container" v-if="item.isOrder">
												<view class="m-0 row">
													<view class="col-12 col">
														<p class="text-gold bold">{{$t('my_rut')}}</p>
													</view>
													<view class="col"><label class="position-status active"></label>
													</view>
												</view>
												<view class="activate-package" >
													<view class="m-0 mt-1 align-items-center row">
														<view class="col">
															<view style="line-height: 8px;"><label
																	class="position-label">{{$t('every_day_rut')}}</label><span
																	class="token-label">{{item['today_rut']}}MTCC</span>
															</view>
														</view>
													</view>
													<!-- <view class="m-0 mt-2 align-items-center row">
														<view class="col">
															<view style="line-height: 8px;"><label
																	class="position-label">{{$t('RUT_Capping_value')}}</label>
																<span class="token-label"
																	style="font-size: 16px;">{{item['multiple']}}
																	USDT
																</span>
															</view>
														</view>
													</view> -->
													<view class="m-0 mt-2 align-items-center row">
														<view class="col">
															<view style="line-height: 8px;">
																<label class="position-label">{{$t('Custody_share')}}</label>
																<span class="token-label"
																	style="font-size: 16px;">{{item['orderCount']}}{{$t('joint')}}
																</span>
																
															</view>
														</view>
													</view>
												</view>
												
											</view>
											
											
											<view class="position-container" v-else>
												
												<view class="activate-package" >
													<view class="m-0 mt-1 align-items-center row">
														<view class="col">
															<u-button type="primary" :loading="isLoadingBuy"
																:loadingText="loadingBuy" class="confirm-button  btn-primary"
																@click="lease(item.id)"
																style="text-align: center;line-height: 30px;height: 30px ;color: #fff;width:100px;border-radius: 20px;font-size: 14px;margin:0 auto">{{$t('LEASE_AGREEMENT')}}</u-button>
											
														</view>
											
													</view>
													
												</view>
												
											</view>
											
											
										</view>
										
									</view>
									
								</view>
							</view>
							<view class="col-12 p-0 col active-card-package">
								<view class="" style="padding: 1em 2em;">
									<view class="m-0 row">
										<view class="d-flex justify-content-between p-0 ">
							                  <view class="" style="font-size: 26rpx;">
							                  	{{$t("Peak_total_orders")}}：{{userinfo.sumRut}}
							                  </view>
											  <view class="" style="font-size: 26rpx;">
											  	{{$t("Total_order_value")}}：{{userinfo.allOrder}}
											  </view>
										</view>
									</view>
								</view>
							</view>
							
						</view>
					</view>
					<view class="col-12 pt-3 col" v-if="userinfo.hhr">
						<view>
							<view class="m-0 row" style="">
								<view class="col-12 col">
									<view class="d-flex align-items-center justify-content-between"><label
											class="text-gold bold">{{$t('Partner')}}</label></view>
					
								</view>
								<view class="col-12 p-0 col">
									<view class="activate-" style="padding: 0.5em 0.3em;">
										<view class="m-0 row">
											<view class="d-flex justify-content-between p-0 ">
					                              <view class="" style="font-size: 26rpx;">
					                              	{{$t("All_platform_dividends")}}：{{userinfo.nethhr}}
					                              </view>
											</view>
										</view>
									</view>
								</view>
								<view class="col-12 p-0 col">
									<view class="activate-" style="padding: 0.5em 0.3em;">
										<view class="m-0 row">
											<view class="d-flex justify-content-between p-0 ">
								                  <view class="" style="font-size: 26rpx;">
								                  	{{$t("Transaction_fees_across_all_platforms")}}：{{userinfo.sxfhhr}}
								                  </view>
											</view>
										</view>
									</view>
								</view>
								<view class="col-12 p-0 col">
									<view class="activate-" style="padding: 0.5em 0.3em;">
										<view class="m-0 row">
											<view class="d-flex justify-content-between p-0 ">
								                  <view class="" style="font-size: 26rpx;">
								                  	{{$t("Released")}}MTCC：{{userinfo.hhr_end}}
								                  </view>
		                                          <view class="" style="font-size: 26rpx;">
		                                          	{{$t("Not_released")}}MTCC：{{userinfo.lock_rut}}
		                                          </view>
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
					
					<view class="col-12 pt-3 col">
						<view>
							<view class="m-0 row" style="">
								<view class="col-12 col">
									<view class="d-flex align-items-center justify-content-between"><label
											class="text-gold bold">{{$t('Lucky_finance')}}</label></view>

								</view>

								<view class="col-12 p-0 col">

									<view class="activate-" style="padding: 0.5em 0.3em;">

										<view class="m-0 row">
											<view class="d-flex justify-content-around p-0 ">

												<u-button :loading="isLoadingUp" :loadingText="loading"
													:customStyle="{ color: '#fff' }" class="activate-button "
													shape="circle" @click="receive">{{$t('Draw-down')}}</u-button>

											</view>
										</view>
									</view>
									<view style="margin-bottom: 10px; line-height: 12px;">
										<span
											style="color: rgb(193, 209, 255); font-size: 22rpx; opacity: 0.9;line-height: 30rpx;margin-left:10rpx">1.{{$t('index_name')}}</span>
										<br>
										<span
											style="color: rgb(193, 209, 255); font-size: 22rpx; opacity: 0.9;line-height: 30rpx;margin-left:10rpx">2.{{$t('index_name1')}}</span>
									</view>

								</view>
							</view>
						</view>
					</view>
					<view class="col-12 pt-3 col">
						<view class="card-one info-panel card">
							<view class="m-0 row">
								<view class="col-12 col">
									<p class="text-gold bold">{{$t('RUT_Real_time_Prices')}}</p>
								</view>
								<view class="col-12 d-flex justify-content-between align-items-center mb-3 col">
									<view class="token-price" style="margin-top: 20rpx;"><span>{{rutPrice}} USDT</span>
										</div>

									</view>
									<view class="line-chart p-0"><canvas role="img" height="356" width="712"
											style="display: block; box-sizing: border-box; height: 178px; width: 356px;"></canvas>
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="col-12 pt-3 col">
						<view>
							<view class="m-0 row">
								<view class="col-12 col">
									<p class="text-gold bold">{{$t('Purchase_record')}}</p>
								</view>
								<view class="col-12 p-0 col" v-for="(item,index) in memberOrderList" :key="index">
									<view class="card-history mt-2 card">

										<view class="history-container">
											<view style="padding: 0.5em 0.3em;">
												<view class="m-0 border-bottom align-items-center row">
													<view class="col"><label>{{item['create_time']}}</label></view>
													<view class="text-center col"><label>{{$t('Purchase-type')}}
															<br>{{financingData[item['type']-1]['name']}}</label>
													</view>
													<view class="text-center col"><label>{{$t('Package_status')}}
															<br>{{item['status']}}</label>
													</view>
													
												</view>
											</view>

										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="col-12 pt-3 col">
						<view>
							<view class="m-0 row">
								<view class="col-12 col">
									<p class="text-gold bold">{{$t('Claim_record')}}</p>
								</view>
								<view class="col-12 p-0 col">
									<view class="card-history mt-2 card" v-for="(item,index) in rutList" :key="index">
										<view class="history-container">
											<view style="padding: 0.5em 0.3em;">
												<view class="m-0 border-bottom align-items-center row">
													<view class="col"><label>{{item['create_time']}}</label></view>
													<view class="text-center col"><label>{{$t('Status_declaration')}}
															<br>{{item['text']}}</label>
													</view>
													<view class="text-center col"><label>{{$t('Amount_received')}}
															<br>{{item['number']}}RUT</label>
													</view>
												</view>
											</view>
										</view>
									</view>
									<view class="uni-pagination-box" v-if="rutList.length>0" style="margin-top: 20rpx;">
										<UniPagination :page-size="pageSize" :current="pageIndex" :total="total"
											@change="change" />
									</view>
								</view>
								<!-- 		<view class="card-package " style="margin-top: 20rpx;">
									<uni-table ref="table" :loading="loadings" border type="table"
										:emptyText="No_further_data_available" @selection-change="selectionChange">
										<uni-tr>
											<uni-th width="100" align="center">{{$t('Participation_time')}}</uni-th>
											<uni-th width="100" align="center">{{$t('Status_declaration')}}</uni-th>
											<uni-th width="100" align="center">{{$t('Amount_received')}}</uni-th>

										</uni-tr>
										<uni-tr v-for="(item, index) in rutList" :key="index">

											<uni-td>
												<view class="name">{{ item.create_time }}</view>
											</uni-td>
											<uni-td align="center">{{item.text}}</uni-td>
											<uni-td align="center">{{item.number}}</uni-td>
										</uni-tr>
									</uni-table>
									<view class="uni-pagination-box">
										<UniPagination :page-size="pageSize" :current="pageIndex" :total="total"
											@change="change" />
									</view>
								</view> -->
							</view>
						</view>
					</view>

				</view>
			</view>
			<view role="dialog" aria-modal="true" v-if="showBuy"
				class="fade confirm-modal-container purchase-wallet-modal modal show" tabindex="-1"
				style="display: block; padding: 20rpx;">
				<view class="modal-dialog modal-md modal-dialog-centered modal-dialog-scrollable">
					<view class="" style="margin:0 auto">
						<view class="col-12 col">
							<view class="card-one info-panel card">
								<view class="m-0  row">

									<view class="col-12 mb-2 col">
										<view class="convert-currency-container card modal-content">
											<view class="modal-header"><label class="title"
													style="font-size: 30rpx;">{{$t('Purchase_package')}}</label>
												<view @click="closeChange" class="right" data-dismiss="modal"
													aria-label="Close"
													style="border: none; stroke: transparent;stroke-width: 0;">
													<svg xmlns="http://www.w3.orgz/2000/svg" width="30" height="30"
														viewBox="0 0 16 16" class="stroke">
														<path fill="none" stroke="#c1d1ff" stroke-width="1.5"
															d="m11.25 4.75l-6.5 6.5m0-6.5l6.5 6.5"></path>
													</svg>

												</view>
											</view>
											<view><label>{{$t('Package_amount')}}</label>

												<view class="input-group">
													<view class="line-group"><input type="text" step="any"
															name="from-currency"
															:value="financingData[select-1]['money']" disabled="">

													</view>
												</view>
											</view>
											<view style="margin-top: 20rpx;" v-if="financingData[select-1]['type']!=4"><label>{{$t('buy_number')}}</label>
											
												<view class="input-group">
													<view class="line-group">
														<input type="text" step="any" name="from-currency" v-model="money">
											                 <view class="" @click="adds(financingData[select-1]['type'])" style="width:36rpx;height:36rpx;background:#ecc394;color:#fff;text-align: center;
															  border-radius: 10rpx; font-size: 40rpx;font-weight: bold;position: absolute;right:140rpx;bottom: 72rpx;line-height: 28rpx;;">
											                 	+
											                 </view>
															 <view class="" @click="dels(financingData[select-1]['type'])" style="width:36rpx;height:36rpx;background:#ecc394;color:#fff;text-align: center;
															  border-radius: 10rpx; font-size: 40rpx;font-weight: bold;position: absolute;right:80rpx;bottom: 72rpx;line-height: 28rpx;;">
															 	-
															 </view>
													</view>
													<span class="form-label-balance">{{$t('Account_amount')}}
														:{{userinfo.balance}}
														{{topChange}}</span>
												</view>
											</view>
											<view style="margin-top: 20rpx;">
												<label>{{$t('input_your_password')}}</label>

												<view class="input-group">
													<view class="line-group">
														<input :placeholder="input_your_password" type="password"
															step="any" name="from-currency" v-model="paypassword" />

													</view>
												</view>
											</view>
											<view>
												<view>
													<u-button type="primary" :loading="isLoadingBuy"
														:loadingText="loadingBuy" class="confirm-button  btn-primary"
														@click="buyOrder"
														style="text-align: center;line-height: 50px;height: 50px ;color: #fff;">{{$t('Firm_purchase')}}</u-button>
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<!-- 弹出框 -->
			<view role="dialog" aria-modal="true" v-if="isft"
				class="fade confirm-modal-container purchase-wallet-modal modal show" tabindex="-1"
				style="display: block; padding: 20rpx;">
				<view class="modal-dialog modal-md modal-dialog-centered modal-dialog-scrollable">
					<view class="" style="margin:0 auto">
						<view class="col-12 col">
							<view class="card-one info-panel card">
								<view class="m-0  row">
			
									<view class="col-12 mb-2 col">
										<view class="convert-currency-container card modal-content">
											<view class="modal-header"><label class="title"
													style="font-size: 30rpx;">{{$t('notices')}}</label>
												<view @click="gotos" class="right" data-dismiss="modal"
													aria-label="Close"
													style="border: none; stroke: transparent;stroke-width: 0;">
													<svg xmlns="http://www.w3.orgz/2000/svg" width="30" height="30"
														viewBox="0 0 16 16" class="stroke">
														<path fill="none" stroke="#c1d1ff" stroke-width="1.5"
															d="m11.25 4.75l-6.5 6.5m0-6.5l6.5 6.5"></path>
													</svg>
			
												</view>
											</view>
											<view class="lease_box">
			
												<view class="">
													{{$t('ft_mseeage')}}
												</view>
											</view>
											
											<view>
												<view>
													<u-button type="primary" :loading="isLoadingBuy"
														:loadingText="loadingBuy" class="confirm-button  btn-primary"
														@click="gotos"
														style="text-align: center;line-height: 50px;height: 50px ;color: #fff;">{{$t('GO_to')}}</u-button>
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<!-- lease -->
            <view role="dialog" aria-modal="true" v-if="leaseOpen"
            	class="fade confirm-modal-container purchase-wallet-modal modal show" tabindex="-1"
            	style="display: block; padding: 20rpx;">
            	<view class="modal-dialog modal-md modal-dialog-centered modal-dialog-scrollable">
            		<view class="" style="margin:0 auto">
            			<view class="col-12 col">
            				<view class="card-one info-panel card">
            					<view class="m-0  row">
            
            						<view class="col-12 mb-2 col">
            							<view class="convert-currency-container card modal-content">
            								<view class="modal-header"><label class="title"
            										style="font-size: 30rpx;">{{$t('End_Lease')}}</label>
            									<view @click="closeChange" class="right" data-dismiss="modal"
            										aria-label="Close"
            										style="border: none; stroke: transparent;stroke-width: 0;">
            										<svg xmlns="http://www.w3.orgz/2000/svg" width="30" height="30"
            											viewBox="0 0 16 16" class="stroke">
            											<path fill="none" stroke="#c1d1ff" stroke-width="1.5"
            												d="m11.25 4.75l-6.5 6.5m0-6.5l6.5 6.5"></path>
            										</svg>
            
            									</view>
            								</view>
            								<view class="lease_box" style="height: 400rpx;overflow-y: auto;">
            
            									<view class="">
            										甲    方： 天玑智盒（香港）科技有限公司
            										地    址： 
            										法定代表人： 
            										
            										乙    方： 
            										
            										身份证号：
            										
            										鉴于：
            										甲、乙双方就智能终端租赁及委托运营业务达成深化合作，建立长期战略合作关系。现依据《中华人民共和国民法典》法律、法规，甲、乙双方本着自愿、平等、互利、诚实信用的原则，经友好协商，就建立全面合作关系，达成如下协议，以供协议双方遵守：
            										
            										
            										
            										
            										第一条  合作内容
            										1.1甲、乙双方同意建立长期合作关系，就智能终端租赁和委托运营业务达成合作。
            										1.2乙方向甲方租赁甲方在海外铺设的智能终端设备，并委托甲方负责维护运营，乙方按比例获取租赁的智能终端设备在运营过程中产生的收益。
            										1.3甲、乙双方同意，本合同签署后，乙方委托甲方租赁智能终端设备，每100美金为一个单元智能终端设备，乙方实际租赁金额和单元数根据甲方线上系统显示的实际订单核定。
            										1.4 每个智能终端单元的租赁费用为100美元，乙方的收益根据实际投入区分（实际合作期限根据乙方实际收益达到峰值收益截止）：
            										租赁单元	月收益	合作期限
            										1-9个	8%	自协议签订之日起满25个月截止
            										10-90个	9%	自协议签订之日起满27.8个月截止
            										100个及以上	10%	自协议签订之日起满30个月截止
            										1.5双方同意合作期间每天进行一次运营数据核对，每天结算一次收益。如合作期间产生其他费用的，双方可另行协商确定承担方式。
            										
            										第二条  双方的权利与义务
            										2.1合作期间，甲方提供智能存储柜相应时段的客服和区域运维服务，以及智能存储柜的软件系统技术升级。
            										2.2甲方负责智能存储柜的日常维护。合作期间及合作终止后，智能存储柜的所有权均归甲方所有。
            										2.3甲方同意，为便于管理，合作期间，本协议项下部分或全部乙方的权利义务可以由乙方的关联方/合作方负责执行。
            										
            										第三条  保密条款
            										3.1甲、乙双方就签订本协议而得知的另一方的任何信息包括但不限于分成比例、产品信息、项目信息、交易结构、往来文件、订单情况等，均属于商业秘密。双方应严格保密，未经对方事先书面同意，不得将上述信息及与本协议有关的任何内容披露给第三方（关联方除外）。
            											3.2上述第3.1条不因本协议或相关协议的无效而失去效力，在本协议有效期限内及本协议终止或解除后，双方均应承担保密责任。本保密条款有效期至相关保密信息进入公开领域时止。
            										3.3为履行本协议的义务，而向适格的合作方披露必须的信息，不受保密义务的规制，但必须提前通知对方，并取得对方同意。
            										3.4本协议第3.1条约定的保密信息不包含以下情况：
            										1)	公共领域的信息；
            										2)	非因信息接收方原因导致大众所知晓的信息；
            										3)	由于法律法规的规定，信息接收方须披露的信息；
            										4)	甲、乙双方的合作关系。
            										3.5 任何一方违反保密条款的应当承担因此给对方造成的一切损失。
            										
            										第四条 签署、 通知
            										4.1乙方在平台上完成电子签署，即表示认可本协议，电子签署后完成后，本合同即视为生效。
            										4.2双方在履行本协议约定内容过程中，因法律、法规、政策的变化，或任一方丧失履行本协议的资格和/或能力，影响本协议履行的，该方应承担在10个工作日内通知其他各方的义务。
            										第五条  法律适用及争议解决
            										5.1与本协议有关的一切事项，包括但不限于协议的成立、效力及履行等事项，均适用现行中华人民共和国法律法规。
            										5.2双方凡因本合同引起的或与本合同有关的任何争议，向被告方所在地人民法院提起诉讼。
            										
            										第六条  违约及其责任
            										6.1本协议生效后，各方应按照本协议及全部附件、附表的规定全面、适当、及时地履行其义务及约定，若本协议的任何一方违反本协议包括全部附件、附表约定的条款，均构成违约。
            										6.2任何一方构成违约的，均应赔偿守约方因此造成的损失。
            										6.3未行使或延迟行使本协议或法律规定的某项权利并不构成对该项权利或其他权利的放弃。单独或部分行使本协议或法律规定的某项权利并不妨碍其进一步继续行使该项权利或其他权利。
            										
            										第七条  协议的变更、解除和终止
            										7.1本协议的任何修改、变更应经协议各方另行协商，并就修改、变更事项共同签署书面协议后方可生效。
            										7.2本协议在下列情况下解除：
            										7.2.1经双方当事人协商一致解除。
            										7.2.2任一方发生违约行为并在守约方向其发出要求更正的书面通知之日起15天内不予更正的，或发生累计两次或以上违约行为，守约方有权单方解除本协议。
            										7.2.3因不可抗力造成本协议无法履行。
            										7.3提出解除协议的一方应当以书面形式通知对方，通知在到达对方时生效。
            										7.4非经本协议双方协商一致并达成书面协议，任何一方不得转让其在本协议或本协议项下全部和/或部分的权利和义务。
            										第八条不可抗力
            										
            										8.1本合同所称不可抗力是指不能预见、不能克服、不能避免并对一方当事人造成重大影响的客观事包括但不限于自然灾書如洪水、地震、火灾和风暴等以及社会事件如战争、动乱、政府行为等。
            										
            										8.2因不可抗力或者其他意外事件，使得本合同的履行不可能、不必要或者无意义的，任一方均可以释除本合同。遭受不可抗力、意外事件的一方通过书面的形式通知对方。
            										
            										第九条  其他条款
            										9.1本协议未尽事宜需要补充的，双方可以另行达成书面协议，作为本协议的附件，本协议附件是本协议不可分割的组成部分。本协议附件与本协议正文不一致的，以本协议附件约定内容为准。
            										9.2除非另有约定或发生法律允许的单方面解除协议的情形，本协议生效后，任何一方不得单方面解除本协议；对本协议的修改或变更须经双方协商一致，并达成书面协议。如因国家法律、法规或政策变化，致使本协议的全部或部分条款不再符合国家法律、法规或政策的要求而产生效力瑕疵的，双方应及时协商，尽快就有关条款达成协议。
            										9.3本协议经双方法定代表人或授权代表签字(或盖章)并加盖公章后生效。
            										9.4本协议以中文书写，正本一式贰份，甲、乙双方各执壹份，具有同等法律效力，本委托租赁协议解释权归 天玑智盒（香港）科技有限公司。
            									</view>
            								</view>
            								
            								<view>
            									<view>
            										<u-button type="primary" :loading="isLoadingBuy"
            											:loadingText="loadingBuy" class="confirm-button  btn-primary"
            											@click="agree"
            											style="text-align: center;line-height: 50px;height: 50px ;color: #fff;">{{$t('End_Lease_complete')}}</u-button>
            									</view>
            								</view>
            							</view>
            						</view>
            					</view>
            				</view>
            			</view>
            		</view>
            	</view>
            </view>
			<!-- uplevel -->
			<view role="dialog" aria-modal="true" v-if="showUplevel"
				class="fade confirm-modal-container purchase-wallet-modal modal show" tabindex="-1"
				style="display: block; padding: 20rpx;">
				<view class="modal-dialog modal-md modal-dialog-centered modal-dialog-scrollable">
					<view class="" style="margin:0 auto">
						<view class="col-12 col">
							<view class="card-one info-panel card">
								<view class="m-0  row">
									<view class="col-12 mb-2 col">
										<view class="convert-currency-container card modal-content">
											<view class="modal-header"><label class="title"
													style="font-size: 30rpx;">{{$t('Upgrade_package')}}</label>
												<view @click="closeUplevel" class="right" type="button"
													data-dismiss="modal" aria-label="Close"><svg
														xmlns="http://www.w3.orgz/2000/svg" width="25" height="25"
														viewBox="0 0 16 16">
														<path fill="none" stroke="#c1d1ff" stroke-linecap="round"
															stroke-linejoin="round" stroke-width="1.5"
															d="m11.25 4.75l-6.5 6.5m0-6.5l6.5 6.5"></path>
													</svg></view>
											</view>
											<view><label>{{$t('Select_package')}}</label>

												<view class="input-group">
													<view class="line-group" v-if="select==1">
														<downSelect ref='selectRef' showKey="name" mode='single'
															:dataList="list" @resultBack="result">
															<view class="select-btn" @click="handleClick">
																{{selectValue.name}}
															</view>
														</downSelect>
													</view>
													<view class="line-group" v-else>
														<downSelect ref='selectRef' showKey="name" mode='single'
															:dataList="lists" @resultBack="result">
															<view class="select-btn" @click="handleClick">
																{{selectValue.name}}
															</view>
														</downSelect>
													</view>
													<span class="form-label-balance">{{$t('Account_amount')}}
														:{{userinfo.balance}}
														{{topChange}}</span>
												</view>
											</view>
											<view style="margin-top: 20rpx;">
												<label>{{$t('input_your_password')}}</label>
												<view class="input-group">
													<view class="line-group"><input :placeholder="input_your_password"
															type="password" step="any" name="from-currency"
															v-model="paypassword" />
													</view>
												</view>
											</view>
											<view>
												<view>
													<u-button type="primary" :loading="isLoadingUp"
														:loadingText="loadingUp" class="confirm-button  btn-primary "
														@click="uplevelOrder"
														style="text-align: center;line-height: 50px;height: 50px">{{$t('Confirmed_upgrade')}}</u-button>
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view v-if="rutList.length==0">
			<view class="listing-container">
				<view class="d-flex justify-content-center  row">
					<view class="     d-grid"><span class="text-center text-empty pt-3">{{$t('No_record')}}</span>
					</view>
				</view>
			</view>
		</view>
		<!-- 	<u-loadmore :loadmoreText="loadText" marginBottom="40" fontSize="12" color="rgba(193, 209, 255, .4)"
			lineColor="rgba(193, 209, 255, .4)" /> -->
	</view>
</template>
<script>
	import topWallet from "@/components/nav/top_wallet.vue"
	import downSelect from "@/components/down-select.vue"
	import UniPagination from "@/components/UniPagination.vue"
	export default {
		components: {
			topWallet,
			downSelect,
			UniPagination
		},
		data() {
			return {
				pageSize: 20,
				isft:false,
				total: 0,
				loadings: false,
				loading: this.$t('Claiming'),
				loadingBuy: this.$t('During_purchase'),
				loadingUp: this.$t('Upgrading'),
				isLoadingBuy: false,
				isLoadingUp: false,
				isLoadingReceive: false,
				money:100,
				userinfo: {},
				list: [{
					name: this.$t('Maker-member'),
					value: 2
				}, {
					name: this.$t('Venture-member'),
					value: 3
				}, ],
				lists: [{
					name: this.$t('Venture-member'),
					value: 3
				}, ],
				selectValue: {
					name: this.$t('Maker-member')
				},
				selectedValue: 2,
				loadText: "",
				input_your_password: this.$t('input_your_password'),
				loadn: false,
				select: 1,
				orderid:'',
				current: 0,
				open_reg: false,
				isopen: false,
				showBuy: false,
				showUplevel: false,
				showChange: false,
				memberOrderList: [],
				rutList: [],
				memberOrderData: [],
				isSubmit: false,
				uplevelId: 1,
				islogin:false,
				names:this.$t('login'),
				pageIndex: 1,
				paypassword: '',
				rutPrice: 0,
				hhrdata:[],
				leaseOpen:false,
				topChange: 'USDT',
				packpageData: [],
				financingData: [{
						name: this.$t('Privileged-member'),
						money: "100 USDT",
						type: 1
					},
					{
						name: this.$t('Maker-member'),
						money: "1000 USDT",
						type: 2,
					},
					{
						name: this.$t('Venture-member'),
						money: "10000 USDT",
						type: 3,
					},
					{
						name: this.$t('Partner'),
						money: "1500 USDT",
						type: 4,
					}
				],
				payTypeStatus: [{
						name: this.$t('Buy')
					},
					{
						name: this.$t('Purchased')
					}
				],
			};
		},
		onLoad: function() {

		},
		onShow() {
			this.tui.haslogin();
			if (this.tui.isLogin()) {
				this.islogin = true;
				this.names = this.tui.hidden(uni.getStorageSync("yy_wallet").address, 3, 4)
				this.init()
			}
		},
		methods: {
			uplevel(id, type) {
				this.showUplevel = true
				this.uplevelId = id
				this.select = type
				if (type == 2) {
					this.selectValue.name = this.$t('Venture-member')
					this.selectedValue = 3;
				}
			},
			closeUplevel() {
				this.showUplevel = false
			},
			handleClick() {
				this.$refs.selectRef.open()
			},
			gotos(){
				this.isft=false;
			},
			result(result) {
				this.selectValue = result[0]

				this.selectedValue = result[0].value
			},
			onChange(e) {
				this.selectedValue = this.list[e.detail.value];

			},
			goBuy(type) {
				this.select = type

				this.showBuy = true
				if(type==1){
					this.money=100;
				}
				if(type==2){
					this.money=1000;
				}
				if(type==3){
					this.money=10000;
				}
				if(type==4){
					this.money=1500;
				}
			},
			closeChange() {
this.leaseOpen = false
				this.showBuy = false
			},
			lease(id){
				this.orderid=id
				this.leaseOpen = true
			},
			agree(){
				
				let token = this.tui.getToken();
				let datas = {
					token: token,
					id:this.orderid,
				};
				
				let result = this.tui.request('/api/user/agreeOrder', 'post', datas, 1000, 1, '', 'agreeOrder');
				Promise.resolve(result).then((value) => {
					
					this.tui.toast(value.message);
					this.leaseOpen = false
					this.init()
				})
			},
			buyOrder() {

				if (this.isLoadingBuy) {
					this.tui.toast(this.$t('waiting_for_submission'));
					return;
				}
				this.isLoadingBuy = true
				// this.isSubmit = true;
				let token = this.tui.getToken();
				let datas = {
					token: token,
					type: this.select,
					password: this.paypassword,
					money:this.money
				};

				let result = this.tui.request('/api/user/createOrder', 'post', datas, 1000, 1, '', 'createOrder');
				Promise.resolve(result).then((value) => {
					if (value.code == 200) {
						this.tui.toast(value.message);
						// this.isSubmit = false;
						setTimeout(() => {
							this.closeChange();
							this.isLoadingBuy = false;
							// location.reload();/
							this.init()
						}, 1000);

						//写入缓存
					} else {
						this.isLoadingBuy = false;
						this.tui.toast(value.message);
					}
				})
			},
			adds(type){
		
				if(type==1){
					if(this.money<=800){
						this.money=this.money+100
					}
					
				}
				if(type==2){
					if(this.money<=8000){
						this.money=this.money+1000
					}
					
				}
				if(type==3){
				
						this.money=this.money+10000
					
					
				}
			},
			dels(type){
					
				if(type==1){
					if(this.money>100){
						this.money=this.money-100
					}
					
				}
				if(type==2){
					if(this.money>1000){
						this.money=this.money-1000
					}
					
				}
				if(type==3){
				
						this.money=this.money-10000
					
					
				}
			},
			uplevelOrder() {
				if (this.isLoadingUp) {
					this.tui.toast(this.$t('waiting_for_submission'));
					return;
				}
				this.isLoadingUp = true;
				let token = this.tui.getToken();
				let datas = {
					token: token,
					type: this.selectedValue,
					password: this.paypassword,
					orderId: this.uplevelId
				};
				let result = this.tui.request('/api/user/uplevelOrder', 'post', datas, 1000, 1, '', 'uplevelOrder');
				Promise.resolve(result).then((value) => {
					if (value.code == 200) {
						this.tui.toast(value.message);
						// this.isSubmit = false;
						setTimeout(() => {
							this.closeUplevel();
							this.isLoadingUp = false
							this.init();
						}, 1000);

						//写入缓存
					} else {
						this.isLoadingUp = false;
						this.tui.toast(value.message);
					}
				})
			},
			receive() {
				this.isLoadingUp = true;
				let token = this.tui.getToken();
				let datas = {
					token: token,
				};
				let result = this.tui.request('/api/user/luckOrder', 'post', datas, 1000, 1, '', 'luckOrder');
				Promise.resolve(result).then((value) => {
					if (value.code == 200) {
						this.tui.toast(value.message);
						setTimeout(() => {
							this.isLoadingUp = false
							this.init();
						}, 1000);
						//写入缓存
					} else {
						this.isLoadingUp = false
						this.tui.toast(value.message);
					}
				})
			},
			init() {
				let datas = {};
				let result = this.tui.request('/api/user/getMemberStatus', 'post', datas, 1000, 1, '', 'getMemberStatus');
				Promise.resolve(result).then((value) => {
					if (value.code == 200) {
						this.memberOrderData = value.data.data
						this.packpageData = value.data.packpage
						this.rutPrice = value.data.rutPrice
                        
					}
				})

				let token = this.tui.getToken();
				let data = {
					token: token,
				};
				let results = this.tui.request('/api/user/userAccount', 'post', data, 1000, 1, '', 'userAccount');

				Promise.resolve(results).then((value) => {
					if (value.code == 200) {
						this.userinfo = value.data;
			        	this.isft=value.data.isft
					} else {
						this.tui.toast(value.message);
					}
				})
				this.getMemberList()
			},
			
			
			// 分页触发
			change(e) {
				// this.$refs.table.clearSelection()
				this.pageIndex = e.current
				this.getMemberList(e.current)
			},
			getMemberList() {
				let boxData = {
					page: this.pageIndex,
				};
				let memberOrder = this.tui.request('/api/user/getMemberOrder', 'post', boxData, 1000, 1, '',
					'getMemberOrder');
				Promise.resolve(memberOrder).then((value) => {
					if (value.code == 200) {
						this.memberOrderList = value.data.data
					}
				})
				let rutData = {
					page: this.pageIndex,
					account_type: 3,
					from_type: 1
				};
				let rutList = this.tui.request('/api/user/bill', 'post', rutData, 1000, 1, '',
					'bill');
				Promise.resolve(rutList).then((value) => {

					if (value.code == 200) {
						this.total = value.data.total_count
						this.rutList = value.data.data
						// if (this.pageIndex == 1) {
						// 	this.rutList = value.data.data
						// } else {
						// 	this.rutList = this.rutList.concat(value.data.data)
						// }
						// if (this.pageIndex < value.data.page_count) {
						// 	this.pageIndex++
						// 	this.loadText = this.$t('load_more')
						// } else {
						// 	this.loadn = true
						// 	this.loadText = this.$t('Have_end')
						// }

					}
				})
			},
			langPop() {
				this.isopen = true
			},
			closeOpen() {
				this.isopen = false
				this.open_reg = false
			},
		},
		onPullDownRefresh() {
			setTimeout(() => {
				uni.stopPullDownRefresh()
			}, 200)
		},
		onReachBottom: function() {
			if (this.loadn) {
				return
			}
			// this.getMemberList()
		},

	};
</script>
<style lang="scss">
	@import '../../static/css/defalut.css';

	page {
		background-color: #252C46;
	}

	.containers {
		// background: url(../../static/images/common/bg.jpg) #000 top no-repeat;

		background-size: 100%;
		margin: 0 !important;
		// -webkit-filter: brightness(70%);
		// filter: brightness(90%);
		width: 100%;
		min-height: 100vh;

	}
    .lease_box{
		width:500rpx;
		min-height: 300rpx;
		margin:20rpx;
		color:#fff;
	}
	.main-app {
		overflow-y: auto;
	}

	.select-btn {
		width: 300rpx;
		height: 60rpx;
		// display: flex;
		flex-direction: row;
		align-items: center;
		// justify-content: center;
		// border: 1rpx solid #e5e5e5;
		// border-radius: 15rpx;
	}

	.stroke {
		stroke: transparent;
		stroke-width: 0;
	}

	svg {
		border: none;
	}

	.right {
		position: absolute;
		right: 1em;
		top: 50%;
		transform: translateY(-50%)
	}

	.activate-button {
		display: flex;
		width: 100px;
		height: 28px;
		justify-content: center;
		align-items: center;
		gap: 10px;
		flex-shrink: 0;
		border: none;
		color: #333 !important
	}

	.u-button__loading-text {
		font-size: 28rpx;
		color: #fff;
	}

	.activate- {
		padding: 15px
	}

	.activate- .row {
		border-radius: 15px;
		border: 1px solid #c1d1ff;
		padding: 15px
	}

	/* 直接覆盖loading状态下的文本颜色 */
	.u-button[loading] .u-button__loading-text {
		color: #ff0000;
		/* 红色 */
	}
</style>